/*
 * By: Werner Schuster (murphee)
 * 
 * Copyright (c) 2005-2006 Werner Schuster (murphee)
 * 
 * This file is part of the EclipseShell project. EclipseShell is subject 
 * to the Eclipse Public License (EPL) available at
 * http://www.eclipse.org/org/documents/epl-v10.php
 * or in the file /epl-v10.html in the source for other info
 * see the /eclipseshell.license file
 */
package net.sf.eclipseshell.editors;

import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextHover;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Region;

public class InterpreterTextHover implements ITextHover {
	
	private ITextHover textHover_;

	public void setTextHover(ITextHover textHover){
		textHover_ = textHover;
	}

	public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
		if(textHover_ != null){
			return textHover_.getHoverInfo(textViewer, hoverRegion);
		}
		return "Hello";
	}

	public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
		if(textHover_ != null){
			return textHover_.getHoverRegion(textViewer, offset);
		}
		return new Region(offset, 1);
	}

}
